//两数之和
class Solution {
public:
    vector<int> twoSum(vector<int>& nums, int target) {
        unordered_map<int, int> h;
        // vector<int>ret;
        for (int i = 0; i < nums.size(); i++) {
            if (h.count(target - nums[i])) {
                return {i, h[target - nums[i]]};
            }
            h[nums[i]] = i;
        }
        // return ret;
        return {};
    }
};